﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using InfoPathDebugger.RuleManager;
using System.Xml.XPath;
using System.Xml;
using System.IO;
using InfoPathDebugger;

namespace RuleManagerTest.Fake
{
    public class RuleManagerFake : RuleManager
    {
        protected override XPathNavigator getMainDataSourceNavigator()
        {
            XmlDocument doc = new XmlDocument();
            StringReader sr = new StringReader(mainDataSourceContent);

            doc.Load(sr);

            XPathNavigator nav = doc.CreateNavigator();
            if (_nsDict == null)
            {
                _nsDict = XPathHelper.RetrieveNamespaces(nav);
            }

            return nav;
        }

        public String mainDataSourceContent = String.Empty;
    }
}
